home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWString / Sources / SLStrRun.cpp < prev    next >
Encoding:
Text File  |  1996-04-25  |  2.8 KB  |  109 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLStrRun.cpp
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10.  
  11. /*
  12.  *  This file was generated by the SOM Compiler.
  13.  *  Generated using: 
  14.  *      SOM Emitter emitxtm.dll: 2.33
  15.  */
  16.  
  17. #include "FWFound.hpp"
  18.  
  19. #ifndef SLSTRREP_H
  20. #include "SLStrRep.h"
  21. #endif
  22.  
  23. #ifndef SOM_Module_ODFStringSubsystem_defined
  24. #include "FWTxtTyp.xh"
  25. #endif
  26.  
  27. #ifndef FWDEBUG_H
  28. #include "FWDebug.h"
  29. #endif
  30.  
  31. #ifndef FWSTRING_H
  32. #include "FWString.h"
  33. #endif
  34.  
  35. #ifndef PRSTRREP_H
  36. #include "PRStrRep.h"
  37. #endif
  38.  
  39. #define FW_OStringRunWriter_Class_Source
  40. #include "SLStrRun.xih"
  41.  
  42. #ifdef FW_BUILD_WIN
  43. #define corbastring string
  44. #endif
  45.  
  46. #ifdef FW_BUILD_MAC
  47. #pragma segment Strings
  48. #endif
  49.  
  50. SOM_Scope FW_OStringRunWriter*  SOMLINK FW_OStringRunWriter__Initialize(FW_OStringRunWriter *somSelf, Environment *ev,
  51.         FW_SPrivStringRep* theString,
  52.         short bufferSize)
  53. {
  54.     FW_SOM_TRY
  55.     {
  56.         FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
  57.         
  58.         FW_ASSERT(theString->fLocked);
  59.         somThis->fString = theString;
  60.         somThis->fBufferSize = bufferSize;
  61.         somThis->fBuffer = new char[bufferSize];
  62.     }
  63.     FW_SOM_CATCH
  64.     return somSelf;
  65. }
  66.  
  67. SOM_Scope void  SOMLINK FW_OStringRunWriter__somInit(FW_OStringRunWriter *somSelf)
  68. {
  69.     FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
  70.     somThis->fBufferSize = 0;
  71.     somThis->fBuffer = 0;
  72.     FW_OStringRunWriter_parent_FW_OTextRunWriter_somInit(somSelf);
  73. }
  74.  
  75. SOM_Scope void  SOMLINK FW_OStringRunWriter__somUninit(FW_OStringRunWriter *somSelf)
  76. {
  77.     FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
  78.     delete [] somThis->fBuffer;
  79.     FW_OStringRunWriter_parent_FW_OTextRunWriter_somUninit(somSelf);
  80. }
  81.  
  82. SOM_Scope corbastring  SOMLINK FW_OStringRunWriter__GetCurrentRun(FW_OStringRunWriter *somSelf, Environment *ev,
  83.         FW_ByteCount* length)
  84. {
  85. FW_UNUSED(ev);
  86.     FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
  87.     *length = somThis->fBufferSize;
  88.     return somThis->fBuffer;
  89. }
  90.  
  91. SOM_Scope void  SOMLINK FW_OStringRunWriter__FlushRun(FW_OStringRunWriter *somSelf, Environment *ev,
  92.         corbastring buffer,
  93.         FW_ByteCount bytesToFlush)
  94. {
  95.     FW_PlatformError error;
  96.     FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
  97.     FW_SPrivStringRep* rep = FW_PrivString_AppendBytes(somThis->fString, buffer, bytesToFlush, &error);
  98.     FW_ASSERT(somThis->fString == rep);
  99.     FW_SetEvError(ev, error);
  100. }
  101.  
  102. SOM_Scope boolean  SOMLINK FW_OStringRunWriter__NewRun(FW_OStringRunWriter *somSelf, Environment *ev, FW_Locale* locale)
  103. {
  104. FW_UNUSED(somSelf);
  105. FW_UNUSED(ev);
  106. FW_UNUSED(locale);
  107.     return false;
  108. }
  109.